using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Windows;
using System.Windows.Documents;
namespace MicroMsg.UI.UserContrl
{
	public class ChatSysInfoItem : BaseChatElement
	{
		private Paragraph sParagraph;
		private string mStrContent;
		private bool _contentLoaded;
		public ChatSysInfoItem()
		{
			this.InitializeComponent();
		}
		public override void OnApplyTemplate()
		{
			base.OnApplyTemplate();
			this.sParagraph = (base.GetTemplateChild("sParagraph") as Paragraph);
			this.RefreshContent();
		}
		private void RefreshContent()
		{
			if (this.sParagraph == null)
			{
				return;
			}
			if (string.IsNullOrEmpty(this.mStrContent))
			{
				return;
			}
			this.sParagraph.get_Inlines().Clear();
			List<InLineResult> inLineResult = InlineElementHelper.GetInLineResult(this.mStrContent);
			using (List<InLineResult>.Enumerator enumerator = inLineResult.GetEnumerator())
			{
				while (enumerator.MoveNext())
				{
					InLineResult current = enumerator.get_Current();
					if (current.mInline != null)
					{
						this.sParagraph.get_Inlines().Add(current.mInline);
					}
				}
			}
		}
		public override void SetMsgContent(string msgContent)
		{
			this.mStrContent = msgContent;
			this.RefreshContent();
		}
		[DebuggerNonUserCode]
		public void InitializeComponent()
		{
			if (this._contentLoaded)
			{
				return;
			}
			this._contentLoaded = true;
			Application.LoadComponent(this, new Uri("/MicroMsg;component/Source/UI/Chat/ChatListItem/ChatSysInfoItem.xaml", 2));
		}
	}
}
